<!DOCTYPE html>
<html>

<head>

    {include file="common:meta"}

</head>
<style>
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">

                <div class="ibox-content">
                    <form method="" class="form-horizontal" id="form" action="">
                        <div class="hr-line-dashed"></div>
                        <div class="form-group has-success">
                            <label class="col-sm-2 control-label">*实际收钻用户ID</label>{$data['u_id']}
                            <div class="col-sm-10">
                                <input type="hidden" name="" value="" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group has-success">
                            <label class="col-sm-2 control-label">*扣除钻石金额</label>
                            <div class="col-sm-10">
                                <input type="hidden" name="" value="" class="form-control">{$data['diamonds']}
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group has-success">
                            <label class="col-sm-2 control-label">*扣除金币金额</label>
                            <div class="col-sm-10">
                                <input type="hidden" name="" value="" class="form-control">{$data['gold']}
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group has-success">
                            <label class="col-sm-2 control-label">*修改接受ID</label>
                            <div class="col-sm-10">
                                <input type="number" id="receive_id" name="receive_id" value="" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group has-success">
                            <label class="col-sm-2 control-label">*修改理由</label>
                            <div class="col-sm-10">
                                <textarea name="msg"  id="msg" cols="50" rows="8" placeholder="必填(只可修改一次)"></textarea>
                            </div>
                        </div>
                        <input type="hidden" name="order_no" value="{$data['order_no']}">
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <input class="btn btn-primary" id="btn-submit" type="button" value="提交">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="common:footer"}
<script>
    //同意申请
    var index = parent.layer.getFrameIndex(window.name);
    $('#btn-submit').click(function(){

        var receive_id = $('#receive_id').val();
        var msg = $('#msg').val();
        if(receive_id == ''){
            layer.msg('修改接受ID必填',{
                icon:2,
                time:2000
            });
            return false;
        }
        if(msg == ''){
            layer.msg('修改理由必填',{
                icon:2,
                time:2000
            });
            return false;
        }
        layer.confirm('确定修改吗？',{
            title:['提示','font-size:18px;font-family:楷体;font-weight:700;'],
            btn: ['确定','取消'] //按钮
        },function(){
            $.ajax({
                type:'get',
                url:'/RechargeEditData',
                async:true,
                data:$('#form').serialize(),
                dataType:'json',
                success:function(result){
                    console.log(result);
                    if(result.code == 100){
                        //   parent.layer.close(index);//关闭当前页
                        layer.msg(result.msg,{
                            icon:1,
                            time:1000
                        });
                        setTimeout(function () {
                            parent.layer.close(index);// 关闭layer
                        },1500);

                    }
                    else{
                        layer.msg(result.msg,{
                            icon:2,
                            time:1000
                        });
                    }
                },
                error:function(err){
                    layer.msg('服务器开小差了！',{
                        time:1500
                    });
                }
            });
        });
    });
</script>
</body>

</html>